<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .img {
            width: 1200px;
            height: 700px;
        }
    </style>
</head>
<body>
    <div id="app">
        <img class="img" :src="list[count]" alt="" >
        <button @click="right">》</button>
    </div>

    <script src="./vue.js"></script>

    <script>
        new Vue ({
            el : "#app" ,
            data : {
                count : 0,
                timer: null,
                list: [
                    "https://pic.netbian.com/uploads/allimg/201207/181626-16073361869ce3.jpg",
                    "https://pic.netbian.com/uploads/allimg/200108/202028-1578486028afb2.jpg",
                    "https://pic.netbian.com/uploads/allimg/220521/000621-1653062781f91a.jpg",
                    "https://pic.netbian.com/uploads/allimg/220114/231414-1642173254d7dd.jpg"
                ]
            },
            created() {
                this.timer = setInterval(() => {
                    this.right()
                } , 1500)
            },
            methods : {
                right() {
                    if (this.count === this.list.length - 1)
                    {
                        this.count = 0
                    } else {
                        this.count += 1
                    }
                }
            }
        })
    </script>
</body>
</html>